<?php 
	session_start();
	require_once("../includes/public.inc.php");
	$username = isset($_SESSION['username'])?$_SESSION['username']:'';
	$type = isset($_GET['type'])?$_GET['type']:'';
	$id = isset($_GET['id'])?$_GET['id']:0;//奖品的id
	//$type =  isset($_GET['type'])?$_GET['type']:'';
	$act = isset($_GET['act'])?$_GET['act']:'';
	$gitfname = isset($_POST['productname'])?$_POST['productname']:'';
	$getway = isset($_POST['productlx'])?$_POST['productlx']:'';
	$qty = isset($_POST['txtQty'])?$_POST['txtQty']:'';
	if(empty($username))
	{
		echo "<script>alert('亲你还没有登录领取哦哦');window.location.href = 'login.php?type='".$type.";</script>";	
		exit;
	}
	else 
	{
		if ($getway&&$gitfname&&$qty)
		{
			$user = mysql_fetch_array(mysql_query("select * from ".DBQIAN."users where username='".$username."' order by id desc limit 1"));
		}
		else 
		{
			echo "<script>alert('提交参数错误！');history.back();</script>";	
			exit;
		}
	}
?>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>地址</title>
<link rel="stylesheet" type="text/css" href="css/geren.css" media="all">
</head>
<body>
	<div class="pz-css">
		<ul class="top-tool">
			<li class="title">礼品将发到该地址</li>
			<li class="back"><a href="javascript:history.go(-1)"></a>
			</li><li class="home"><a href="index.php?us_id=&amp;openid=&type=<?=$type?>"></a></li>
		</ul>
		<form action="credit_get.php?act=dui&id=<?=$id?>&type=<?=$type?>" id="submit_form" method="post">
			<div class="pz-panel" style="background-color: rgb(255, 255, 255);">
				<table class="list" border="0" cellspacing="0" width="100%">
					<tbody>
					<tr>
						<td style="color: red;" width="90">手机号码：</td>
						<td align="left"><span class="span12"><?=$user['username']?></span></td>
					</tr>
					<tr>
						<td>详细地址：</td>
						<td align="left"><span class="span12"><?=$user['address']?></span></td>
					</tr>
	            	<input name="txtQty" value="<?=$qty?>" type="hidden" />
		            <input name="productname" value="<?=$gitfname?>" type="hidden" />
		            <input name="productlx" value="<?=$getway?>" type="hidden" />
	            	<input name="id" value="<?=$id?>" type="hidden" />
					</tbody>
				</table>
			</div>
			<div class="group">
				<div class="span6">
					<button type="button"  onclick="location.href='geren.php?type=<?=$type?>'">去修改地址</button>
				</div>
				<div class="span6"><button class="red">兑换礼品</button></div>
			</div>
		</form>
	</div>
</body>
</html>